// src/store/index.js  
import {
	createStore
} from 'vuex';

export default createStore({
	state() {
		return {
			connectF: false,
			deviceMac: '',
			deviceCounts: 0,
			deviceOBj: {},
		};
	},
	mutations: {
		incrementDeviceCount(state, payload) {
			state.deviceCounts++;
		},
		resetDeviceCount(state, payload) {
			state.deviceCounts = payload;
		},
		updateBLEConnectStatus(state, status) {
			state.connectF = status;
		},
		updateBLECmac(state, status) {
			state.deviceMac = status;
		},
		updateBLEConnectobj(state, status) {
			state.deviceOBj = status;
		},
	},
	actions: {
		setWifiNameLength({
			commit
		}, payload) {
			commit('incrementDeviceCount', payload);
		},
		setWifioneLength({
			commit
		}, payload) {
			commit('resetDeviceCount', payload);
		},
	},

	modules: {}
});